﻿#ifndef USERDAO_H
#define USERDAO_H

#include "user.h"
#include <QObject>

class UserDao
{
public:
    explicit UserDao(QSqlDatabase sqlDatabase);
    bool getList(QList<User> &list, const QVariantMap &param = {});
    bool getTotal(uint64_t &total, const QVariantMap &param = {});
    bool getOne(User &object);
    bool saveOne(User &object, QBaseEntity::PropertiesType propertiesType = QBaseEntity::AllProperty, QStringList properties = {});
    bool deleteOne(User &object);

private:
    QSqlDatabase db;
};

#endif // USERDAO_H
